﻿using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
using ZeroAdmin.Application;

namespace ZeroAdmin.Web.Core;

/// <summary>
/// 用户服务
/// </summary>
[ApiDescriptionSettings(Name = "User", Order = 99, Tag = "用户服务")]
public class UserController(IUserService service) : IDynamicApiController
{
    private readonly IUserService _service = service;

    /// <summary>
    /// 添加用户
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task<long> AddUser(AddUserInput input)
    {
        return await _service.AddUser(input);
    }

    /// <summary>
    /// 更新用户
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    public async Task<long> UpdateUser(UpdateUserInput input)
    {
        return await _service.UpdateUser(input);
    }

    /// <summary>
    /// 删除用户
    /// </summary>
    /// <param name="UserId">用户ID</param>
    /// <returns></returns>
    public async Task DeleteUser(long UserId)
    {
        await _service.DeleteUser(UserId);
    }
}
